-- GENERATED SPELL FOR [Bladespire Mystic] --


function spell0_20766(pUnit, Event) --@Bloodlust,n/a--
pUnit:FullCastSpellOnTarget(37599,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20766', 15280, 1)
end

function spell1_20766(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(11986,pUnit)
pUnit:RegisterEvent('Sorts_20766', 3000, 1)
end

function spell2_20766(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(12550,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20766', 0, 1)
end

function Sorts_20766(pUnit, Event)
local choix_sorts_20766 = math.random(0, 2)
if choix_sorts_20766 == 0 then
pUnit:RegisterEvent('spell0_20766', 1, 1)
end
if choix_sorts_20766 == 1 then
pUnit:RegisterEvent('spell1_20766', 1, 1)
end
if choix_sorts_20766 == 2 then
pUnit:RegisterEvent('spell2_20766', 1, 1)
end
end

function mob20766_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20766', math.random(1500, 3000), 1)
end

function mob20766_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20766_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20766_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20766, 1, 'mob20766_Action')
RegisterUnitEvent(20766, 2, 'mob20766_Leave')
RegisterUnitEvent(20766, 3, 'mob20766_Kill')
RegisterUnitEvent(20766, 4, 'mob20766_Die')
